<template>
    <div>
        <el-bread></el-bread>
        <el-button type="primary" @click="show" plain class="addBtn" size="mini">添加</el-button>
        <!-- 引入表格 -->
        <v-list @edit="edit"></v-list>
        <!-- 引入对话框 -->
        <v-dialog :zhe="zhe" :isAdd="isAdd" @close="close" ref="dialogRef"></v-dialog>


    </div>
</template>
<script>
import vList from "./list.vue"
import vDialog from "./dialog.vue"
export default {
    data() {
        return {
            // 定义一个变量用来控制弹窗
            zhe: false,
            //定义一个变量来判断用户点的是添加还是编辑
            isAdd: true
        }
    },
    methods: {
        //点击显示对话框
        show() {
            this.zhe = true
        },
        //点击关闭对话框
        close() {
            this.zhe = false
        },
        //点击编辑调出弹窗
        edit(e) {
            this.zhe = true
            this.isAdd = false
            this.$refs.dialogRef.lookup(e)
        }

    },

    watch: {},
    computed: {},
    filters: {},
    components: {
        vList, vDialog
    }
}
</script>
<style scoped>
.addBtn {
    margin: 1.25rem 0 1.25rem 0;

}
</style>